package com.example.testnginxupstream.controller;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class Api1Controller {
    @RequestMapping(value = "test-upstream")
    public Map<String, Object> postTest1(Map<String, Object> req) {
        Map<String, Object> resp = new HashMap<>();
        resp.put("code", "00");
        System.out.println("test2" + System.currentTimeMillis() +
                " " + Thread.currentThread().getName() + "=" + Thread.currentThread().getId());
        try {
            Thread.sleep(300);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return resp;
    }
}
